package dao;

import pojo.MedDevClass;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MedDevClassMapper {
//    @Insert("INSERT INTO t_med_dev_class(name, description) VALUES(#{name}, #{description})")
//    @Options(useGeneratedKeys = true, keyProperty = "id")
//    int insertMedDevClass(MedDevClass record);
//
//    @Delete("DELETE FROM t_med_dev_class WHERE id = #{id}")
//    int delMedDevClassById(Integer id);
//
//    @Update("UPDATE t_med_dev_class SET name = #{name}, description = #{description} WHERE id = #{id}")
//    int updateMedDevClassById(MedDevClass record);
    //前三个是通过@Select注解方式实现

    @Select("INSERT INTO t_med_dev_class(name,description) VALUES(#{name},#{description})")
    void insertMedDevClass(MedDevClass record);

    @Select("DELETE FROM t_med_dev_class WHERE id = #{id}")
    void delMedDevClassById(Integer id);

    @Select("UPDATE t_med_dev_class SET name = #{name},description = #{description} WHERE id = #{id}")
    void updateMedDevClassById(MedDevClass record);

    //前三个是通过Mapper.xml方式实现
    MedDevClass selectMedDevClassById(Integer id);

    List<MedDevClass> findAllMedDevClass();

    List<MedDevClass> findMedDevClassByNameAndDes(MedDevClass record);
}